-- cure_sum
-- create by zhuangsl
-- 技能: 宠物恢复玩家生命值(目标生命百分比)
-- cure_hp(10,500)：恢复10 + 50% * floor点生命值

return {
    apply = function(source, target, skillId, round, para, extra)
        -- 恢复的生命值
        local floor = DungeonM.currentLayer();
        local hp = para[1] + math.modf(para[2] * floor / 1000);

        -- 不超过上限
        local targetHp = target:queryAttrib("hp");
        local maxHp = target:queryAttrib("max_hp");
        if targetHp + hp > maxHp then
            hp = math.max(maxHp - targetHp, 0);
        end

        CombatM.receiveCure(source, target, hp);

        -- 回血事件
        EventMgr.fire(event.HP_RECOVER, hp);

        -- 作用目标
        return { target, };
    end,

    parse = function(desc)
        local arr = string.explode(desc, ",");
        return { tonumber(arr[1]), tonumber(arr[2]), };
    end,

    -- 解析技能描述
    parseDesc = function(source, skillId, desc, para)
        return desc;
    end,
}

